/**
 * jQuery MD5 hash algorithm function
 *
 * 	<code>
 * 		Calculate the md5 hash of a String
 * 		String $.md5 ( String str )
 * 	</code>
 *
 * Calculates the MD5 hash of str using the » RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash.
 * MD5 (Message-Digest algorithm 5) is a widely-used cryptographic hash function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of data. The generated hash is also non-reversable. Data cannot be retrieved from the message digest, the digest uniquely identifies the data.
 * MD5 was developed by Professor Ronald L. Rivest in 1994. Its 128 bit (16 byte) message digest makes it a faster implementation than SHA-1.
 * This script is used to process a variable length message into a fixed-length output of 128 bits using the MD5 algorithm. It is fully compatible with UTF-8 encoding. It is very useful when u want to transfer encrypted passwords over the internet. If you plan using UTF-8 encoding in your project don't forget to set the page encoding to UTF-8 (Content-Type meta tag).
 * This function orginally get from the WebToolkit and rewrite for using as the jQuery plugin.
 *
 * Example
 * 	Code
 * 		<code>
 * 			$.md5("I'm Persian.");
 * 		</code>
 * 	Result
 * 		<code>
 * 			"b8c901d0f02223f9761016cfff9d68df"
 * 		</code>
 *
 * @alias Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com >
 * @link //www.semnanweb.com/jquery-plugin/md5.html
 * @see //www.webtoolkit.info/
 * @license //www.gnu.org/licenses/gpl.html [GNU General Public License]
 * @param {jQuery} {md5:function(string))
 * @return string
 */
(function($){
    var rotateLeft = function(lValue, iShiftBits) {
        return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
    }
    var addUnsigned = function(lX, lY) {
        var lX4, lY4, lX8, lY8, lResult;
        lX8 = (lX & 0x80000000);
        lY8 = (lY & 0x80000000);
        lX4 = (lX & 0x40000000);
        lY4 = (lY & 0x40000000);
        lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
        if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
        if (lX4 | lY4) {
            if (lResult & 0x40000000) return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
            else return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
        } else {
            return (lResult ^ lX8 ^ lY8);
        }
    }
    var F = function(x, y, z) {
        return (x & y) | ((~ x) & z);
    }
    var G = function(x, y, z) {
        return (x & z) | (y & (~ z));
    }
    var H = function(x, y, z) {
        return (x ^ y ^ z);
    }
    var I = function(x, y, z) {
        return (y ^ (x | (~ z)));
    }
    var FF = function(a, b, c, d, x, s, ac) {
        a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac));
        return addUnsigned(rotateLeft(a, s), b);
    };
    var GG = function(a, b, c, d, x, s, ac) {
        a = addUnsigned(a, addUnsigned(addUnsigned(G(b, c, d), x), ac));
        return addUnsigned(rotateLeft(a, s), b);
    };
    var HH = function(a, b, c, d, x, s, ac) {
        a = addUnsigned(a, addUnsigned(addUnsigned(H(b, c, d), x), ac));
        return addUnsigned(rotateLeft(a, s), b);
    };
    var II = function(a, b, c, d, x, s, ac) {
        a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac));
        return addUnsigned(rotateLeft(a, s), b);
    };
    var convertToWordArray = function(string) {
        var lWordCount;
        var lMessageLength = string.length;
        var lNumberOfWordsTempOne = lMessageLength + 8;
        var lNumberOfWordsTempTwo = (lNumberOfWordsTempOne - (lNumberOfWordsTempOne % 64)) / 64;
        var lNumberOfWords = (lNumberOfWordsTempTwo + 1) * 16;
        var lWordArray = Array(lNumberOfWords - 1);
        var lBytePosition = 0;
        var lByteCount = 0;
        while (lByteCount < lMessageLength) {
            lWordCount = (lByteCount - (lByteCount % 4)) / 4;
            lBytePosition = (lByteCount % 4) * 8;
            lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
            lByteCount++;
        }
        lWordCount = (lByteCount - (lByteCount % 4)) / 4;
        lBytePosition = (lByteCount % 4) * 8;
        lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
        lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
        lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
        return lWordArray;
    };
    var wordToHex = function(lValue) {
        var WordToHexValue = "", WordToHexValueTemp = "", lByte, lCount;
        for (lCount = 0; lCount <= 3; lCount++) {
            lByte = (lValue >>> (lCount * 8)) & 255;
            WordToHexValueTemp = "0" + lByte.toString(16);
            WordToHexValue = WordToHexValue + WordToHexValueTemp.substr(WordToHexValueTemp.length - 2, 2);
        }
        return WordToHexValue;
    };
    var uTF8Encode = function(string) {
        string = string.replace(/\x0d\x0a/g, "\x0a");
        var output = "";
        for (var n = 0; n < string.length; n++) {
            var c = string.charCodeAt(n);
            if (c < 128) {
                output += String.fromCharCode(c);
            } else if ((c > 127) && (c < 2048)) {
                output += String.fromCharCode((c >> 6) | 192);
                output += String.fromCharCode((c & 63) | 128);
            } else {
                output += String.fromCharCode((c >> 12) | 224);
                output += String.fromCharCode(((c >> 6) & 63) | 128);
                output += String.fromCharCode((c & 63) | 128);
            }
        }
        return output;
    };
    $.extend({
        md5: function(string) {
            var x = Array();
            var k, AA, BB, CC, DD, a, b, c, d;
            var S11=7, S12=12, S13=17, S14=22;
            var S21=5, S22=9 , S23=14, S24=20;
            var S31=4, S32=11, S33=16, S34=23;
            var S41=6, S42=10, S43=15, S44=21;
            string = uTF8Encode(string);
            x = convertToWordArray(string);
            a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;
            for (k = 0; k < x.length; k += 16) {
                AA = a; BB = b; CC = c; DD = d;
                a = FF(a, b, c, d, x[k+0],  S11, 0xD76AA478);
                d = FF(d, a, b, c, x[k+1],  S12, 0xE8C7B756);
                c = FF(c, d, a, b, x[k+2],  S13, 0x242070DB);
                b = FF(b, c, d, a, x[k+3],  S14, 0xC1BDCEEE);
                a = FF(a, b, c, d, x[k+4],  S11, 0xF57C0FAF);
                d = FF(d, a, b, c, x[k+5],  S12, 0x4787C62A);
                c = FF(c, d, a, b, x[k+6],  S13, 0xA8304613);
                b = FF(b, c, d, a, x[k+7],  S14, 0xFD469501);
                a = FF(a, b, c, d, x[k+8],  S11, 0x698098D8);
                d = FF(d, a, b, c, x[k+9],  S12, 0x8B44F7AF);
                c = FF(c, d, a, b, x[k+10], S13, 0xFFFF5BB1);
                b = FF(b, c, d, a, x[k+11], S14, 0x895CD7BE);
                a = FF(a, b, c, d, x[k+12], S11, 0x6B901122);
                d = FF(d, a, b, c, x[k+13], S12, 0xFD987193);
                c = FF(c, d, a, b, x[k+14], S13, 0xA679438E);
                b = FF(b, c, d, a, x[k+15], S14, 0x49B40821);
                a = GG(a, b, c, d, x[k+1],  S21, 0xF61E2562);
                d = GG(d, a, b, c, x[k+6],  S22, 0xC040B340);
                c = GG(c, d, a, b, x[k+11], S23, 0x265E5A51);
                b = GG(b, c, d, a, x[k+0],  S24, 0xE9B6C7AA);
                a = GG(a, b, c, d, x[k+5],  S21, 0xD62F105D);
                d = GG(d, a, b, c, x[k+10], S22, 0x2441453);
                c = GG(c, d, a, b, x[k+15], S23, 0xD8A1E681);
                b = GG(b, c, d, a, x[k+4],  S24, 0xE7D3FBC8);
                a = GG(a, b, c, d, x[k+9],  S21, 0x21E1CDE6);
                d = GG(d, a, b, c, x[k+14], S22, 0xC33707D6);
                c = GG(c, d, a, b, x[k+3],  S23, 0xF4D50D87);
                b = GG(b, c, d, a, x[k+8],  S24, 0x455A14ED);
                a = GG(a, b, c, d, x[k+13], S21, 0xA9E3E905);
                d = GG(d, a, b, c, x[k+2],  S22, 0xFCEFA3F8);
                c = GG(c, d, a, b, x[k+7],  S23, 0x676F02D9);
                b = GG(b, c, d, a, x[k+12], S24, 0x8D2A4C8A);
                a = HH(a, b, c, d, x[k+5],  S31, 0xFFFA3942);
                d = HH(d, a, b, c, x[k+8],  S32, 0x8771F681);
                c = HH(c, d, a, b, x[k+11], S33, 0x6D9D6122);
                b = HH(b, c, d, a, x[k+14], S34, 0xFDE5380C);
                a = HH(a, b, c, d, x[k+1],  S31, 0xA4BEEA44);
                d = HH(d, a, b, c, x[k+4],  S32, 0x4BDECFA9);
                c = HH(c, d, a, b, x[k+7],  S33, 0xF6BB4B60);
                b = HH(b, c, d, a, x[k+10], S34, 0xBEBFBC70);
                a = HH(a, b, c, d, x[k+13], S31, 0x289B7EC6);
                d = HH(d, a, b, c, x[k+0],  S32, 0xEAA127FA);
                c = HH(c, d, a, b, x[k+3],  S33, 0xD4EF3085);
                b = HH(b, c, d, a, x[k+6],  S34, 0x4881D05);
                a = HH(a, b, c, d, x[k+9],  S31, 0xD9D4D039);
                d = HH(d, a, b, c, x[k+12], S32, 0xE6DB99E5);
                c = HH(c, d, a, b, x[k+15], S33, 0x1FA27CF8);
                b = HH(b, c, d, a, x[k+2],  S34, 0xC4AC5665);
                a = II(a, b, c, d, x[k+0],  S41, 0xF4292244);
                d = II(d, a, b, c, x[k+7],  S42, 0x432AFF97);
                c = II(c, d, a, b, x[k+14], S43, 0xAB9423A7);
                b = II(b, c, d, a, x[k+5],  S44, 0xFC93A039);
                a = II(a, b, c, d, x[k+12], S41, 0x655B59C3);
                d = II(d, a, b, c, x[k+3],  S42, 0x8F0CCC92);
                c = II(c, d, a, b, x[k+10], S43, 0xFFEFF47D);
                b = II(b, c, d, a, x[k+1],  S44, 0x85845DD1);
                a = II(a, b, c, d, x[k+8],  S41, 0x6FA87E4F);
                d = II(d, a, b, c, x[k+15], S42, 0xFE2CE6E0);
                c = II(c, d, a, b, x[k+6],  S43, 0xA3014314);
                b = II(b, c, d, a, x[k+13], S44, 0x4E0811A1);
                a = II(a, b, c, d, x[k+4],  S41, 0xF7537E82);
                d = II(d, a, b, c, x[k+11], S42, 0xBD3AF235);
                c = II(c, d, a, b, x[k+2],  S43, 0x2AD7D2BB);
                b = II(b, c, d, a, x[k+9],  S44, 0xEB86D391);
                a = addUnsigned(a, AA);
                b = addUnsigned(b, BB);
                c = addUnsigned(c, CC);
                d = addUnsigned(d, DD);
            }
            var tempValue = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
            return tempValue.toLowerCase();
        }
    });
})(jQuery);

/**
 * Created by Administrator on 2016/5/19.
 */
/*******************************************************************************
 * 数据库访问功能
 ******************************************************************************/
if (window.location.href.indexOf('7lodge') >= 0) {
    baseUrl = '//back.7lodge.com:8000/web/';
    baseUrl_https = '//back.7lodge.com:8000/web/';
}
else if (window.location.href.indexOf('test') >= 0) {
    baseUrl = '//backtest.onehome.me/web/';
    baseUrl_https = 'https://backtest.onehome.me/web/';
}
else if (window.location.href.indexOf('onehome.me') >= 0) {
    // baseUrl = '//back187.onehome.me/web/';
    // baseUrl_https = 'https://back187.onehome.me/web/';
    baseUrl = '//back210.onehome.me/web/';
    baseUrl_https = 'https://back210.onehome.me/web/';
}
else {
    // baseUrl = '//back210.onehome.me/web/';
    // baseUrl_https = 'https://back210.onehome.me/web/';
    baseUrl = '//back.7lodge.com:8000/web/';
    baseUrl_https = '//back.7lodge.com:8000/web/';
}

/*******************************************************************************
 * 功能：发送网络请求并获取数据【待优化】
 ******************************************************************************/
currentAjax = 0;
function treatData(){
    var baseUrl = baseUrl_https;
    var url = arguments[0] ? arguments[0] : null;
    var param = arguments[1] ? arguments[1] : '';
    var callBack = arguments[2] ? arguments[2] : '';
    var errorBack = arguments[3] ? arguments[3] : '';
    var systemParam = {
        deviceType:'web_'+$.cookie('deviceType'),
        model:navigator.userAgent,
	    platform:navigator.platform,
        version:($.cookie('version'))?$.cookie('version'):'3.3.1',
        timestamps: createTimeStamp('ms'),
        apiVersion: '2.1',
        area: ($.cookie('language'))?$.cookie('language'):'zh'
    };
    var systemParamValue = JSON.stringify(systemParam);

    // 生成tokenSign
    var kARB1 = param ? JSON["\x70\x61\x72\x73\x65"](param) : {};    var LzKI2 = $["\x65\x78\x74\x65\x6e\x64"]({},kARB1,systemParam);    var P3 = window["\x4f\x62\x6a\x65\x63\x74"]["\x6b\x65\x79\x73"](LzKI2)["\x73\x6f\x72\x74"]();    var zj4 = [];    for(var urlNcXmc5 in P3){        if(typeof LzKI2[P3[urlNcXmc5]] == '\x6f\x62\x6a\x65\x63\x74'){            LzKI2[P3[urlNcXmc5]] = JSON["\x73\x74\x72\x69\x6e\x67\x69\x66\x79"](LzKI2[P3[urlNcXmc5]]);        }        zj4["\x70\x75\x73\x68"](P3[urlNcXmc5]+'\x3d'+urlencode(emoji2Str(LzKI2[P3[urlNcXmc5]])))    }    var z7 = zj4["\x6a\x6f\x69\x6e"]('\x26') + '\x46\x43\x38\x33\x43\x44\x42\x41\x45\x46\x42\x37\x31\x34\x42\x36\x35\x30\x46\x41\x35\x36\x38\x35\x32\x41\x46\x31\x43\x44\x36\x37';    var jOUjRD8 = $["\x6d\x64\x35"](z7)["\x74\x6f\x55\x70\x70\x65\x72\x43\x61\x73\x65"]();    kARB1["\x74\x6f\x6b\x65\x6e\x53\x69\x67\x6e"] = jOUjRD8;    param = JSON["\x73\x74\x72\x69\x6e\x67\x69\x66\x79"](kARB1);

    if(url == null){
        var status = {};
        status.status_code = '00000';
        status.status_reason = $.i18n.prop('11d21c75650a2ecc243661a0c3750942');
        return status;
    }else{
        var postUrl = baseUrl+url+"?param="+param+"&systemParam="+systemParamValue;
        var ajaxUrl = baseUrl+url;
        if(url.indexOf('onehome.me')>=0 || url.indexOf('7lodge.com')>=0){
            postUrl = url+"?param="+param+"&systemParam="+systemParamValue;
            ajaxUrl = url;
        }
        //地图接口转换
//        if(systemParamValue.indexOf('web_map') >= 0){
//            ajaxUrl = ajaxUrl.replace("back.onehome.me", "api.9droom.com");
//        }
        currentAjax = $.ajax({
            url:'/web/' + url,
            data:{param:param,systemParam:systemParamValue},
            type:'POST',
            success:function(result) {
                result = JSON.parse(result);
                switch (result.status.status_code){
                    case 0:
                        if(callBack){callBack(result,postUrl);}else{return result;}
                        break;
                    case 101:
                        if(callBack){callBack(result,postUrl);}else{return result;}
                        break;
                    default:
                        if(callBack){callBack(result,postUrl);}else{return result;}
                        break;
                }
            },
            error:function(){
                var status = {};
                status.status_code = '00001';
                status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
                var data = {status: status};
                if(errorBack){errorBack(data,postUrl);}else{return status;}
            },
            timeout:20000
        });
    }
}

/******
 * 兴趣爱好列表
 * *****/
function getInterestListfn(fn){
    //var myDate = new Date();
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.create = 1;
    var value = JSON.stringify(param);
    treatData("/userInfo/getUserInterest", value, function(data) {
        var res = {};
        if(0 == data.status.status_code){
            res.code = true;
            res.data = data.result;
        }else{
            res.code = false;
            res.mess =  data.status.status_reason;
        };
        if (fn) fn(res);
    });
}


/********
 * 保存用户的单个信息
 * *********/
function userInforSingleSavefn(key,value,fn){
    var myDate = new Date();
    treatData("/user/c_editUserInforSingle", {
        key:key,value:value,date:myDate
    }, function(data) {
        var res = {};
        if(0 == data.status.status_code){
            res.code = true;
            res.data = data.result;
        }else{
            res.code = false;
            res.mess =  data.status.status_reason;
        };
        if (fn) fn(res);
    });
}

/********
 * 完善信息提交
 * *********/
function changeUserInforfn(faceUrl,nickName,sex,interestId,fn) {
    var myDate = new Date();
    var yyoh=$.cookie('yyoh');
    var userId=$.cookie('id');
    var boo = true;
    var infor_back = '';

    //var yyoh = 'xRBerQMTkTbLYdP7G3TrQFHmD4nex9zSwlPo0GALbXk3D';
    //var userId = 'ked1f832n461r4pb55igsakmj5';
    if (!faceUrl) {
        infor_back = infor_back + $.i18n.prop('a31f47931d9604efe296f7a1ae208d77');
        boo = false;
    }
    if (nickName.length == 0 || nickName.length > 30) {
        if (nickName.length == 0) {
            infor_back = infor_back + $.i18n.prop('bcf102931fb5c74c4f2d844e82b3933b');
        } else {
            infor_back = infor_back + $.i18n.prop('6448b03e58a9a274a72576cf955074d0');
        }
        boo = false;
    }
    if (sex == '') {
        infor_back = infor_back + $.i18n.prop('149db735f95c376f7c08971ef8434339');
        boo = false;
        //$('#sex').focus().addClass('bg_color');
    }

    if (!boo) {
        if (fn) fn({infor_back:infor_back});
        return ;

    } else {
        try{
            var dataparam = JSON.stringify({
                faceUrl: faceUrl,
                nickName: nickName,
                sex: sex,
                interestId: interestId,
                yyoh: yyoh,
                userId: userId
            });
            treatData("/userInfo/perfectInformation",dataparam, function (data) {
                var res = {};
                if (0 == data.status.status_code) {
                    res.code = true;
                    //res.data = data.result;
                } else {
                    res.code = false;
                    res.mess = data.status.status_reason;
                }
                ;
                if (fn) fn(res);
            });
        }
        catch(e){
            console.log(e);
        }

    }
}function changeUserInforfnNew(faceUrl,nickName,fn) {
    var myDate = new Date();
    var yyoh=$.cookie('yyoh');
    var userId=$.cookie('id');
    var boo = true;
    var infor_back = '';

    //var yyoh = 'xRBerQMTkTbLYdP7G3TrQFHmD4nex9zSwlPo0GALbXk3D';
    //var userId = 'ked1f832n461r4pb55igsakmj5';
    if (!faceUrl) {
        infor_back = infor_back + $.i18n.prop('a31f47931d9604efe296f7a1ae208d77');
        boo = false;
    }
    if (nickName.length == 0 || nickName.length > 30) {
        if (nickName.length == 0) {
            infor_back = infor_back + $.i18n.prop('bcf102931fb5c74c4f2d844e82b3933b');
        } else {
            infor_back = infor_back + $.i18n.prop('6448b03e58a9a274a72576cf955074d0');
        }
        boo = false;
    }
    if (!boo) {
        if (fn) fn({infor_back:infor_back});
        return ;

    } else {
        try{
            var dataparam = JSON.stringify({
                faceUrl: faceUrl,
                nickName: nickName,
                yyoh: yyoh,
                userId: userId
            });
            treatData("/userInfo/perfectInformation",dataparam, function (data) {
                var res = {};
                if (0 == data.status.status_code) {
                    res.code = true;
                    //res.data = data.result;
                } else {
                    res.code = false;
                    res.mess = data.status.status_reason;
                }
                ;
                if (fn) fn(res);
            });
        }
        catch(e){
            console.log(e);
        }

    }
}

/*******************************************************************************
 * 功能：获取用户的订单列表
 * 参数：role(用户角色) page(当前页,第一页为1) pageSize(每页个数) typeNum(货币类型) port(接口名称)
 * 作者：jame
 * 时间：2016-05-24 04:23
 ******************************************************************************/
function getOrderList(role,page,pageSize,typeNum,port,fn,key){
    if(!role){
        role = 1;
    }
    if(!page){
        page = 1;
    }
    if(!pageSize){
        pageSize = 10;
    }
    if(!typeNum){
        typeNum = publicMethods.getBuyerCurrency();
    }
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.role = role;
    var page = page;
    var range = {};
    range.pageSize = pageSize;
    range.page = page-1;
    param.range = range;
    param.typeNum = typeNum;
    if(key != ''){
	    param.orderNo = key;
    }
    var value = JSON.stringify(param);
    treatData('order/'+port,value,function(data,url){
        if(fn){
            range.page++;
            fn(data,range);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}


/*******************************************************************************
 * 功能：审核或者拒绝通过用户的订单
 * 参数：orderId(订单id) isAdopt(1表示审核通过，2表示审核拒绝) fn(回调函数)
 * 作者：jame
 * 时间：2016-05-25 00:48
 ******************************************************************************/
function auditOrder(orderId,infotype,infostatus,payStatus,infocontent,isAdopt,fn){
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');

    if(!orderId){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('790782b4a006034bcb0ee60fb94526f2')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    if(isAdopt==0)
    {
        if(!infotype){
            var data={
                status:{
                    status_code:-1,
                    status_reason:$.i18n.prop('e6f8a6b01e7aae89795387491071ec27')
                }
            };
            if(fn)
            {
                fn(data);
                return;
            }

        }
        if(!infostatus){
            var data={
                status:{
                    status_code:-1,
                    status_reason:$.i18n.prop('45996d39197f18c3af493abca3a1d3d1')
                }
            };
            if(fn)
            {
                fn(data);
                return;
            }

        }
        if(!payStatus){
            var data={
                status:{
                    status_code:-1,
                    status_reason:$.i18n.prop('45996d39197f18c3af493abca3a1d3d1')
                }
            };
            if(fn)
            {
                fn(data);
                return;
            }
        }
        //if(!infocontent){
        //    var data={
        //        status:{
        //            status_code:-1,
        //            status_reason:'取消原因不能为空'
        //        }
        //    };
        //    if(fn)
        //    {
        //        fn(data);
        //        return;
        //    }
        //}

        param.type = infotype;
        param.status = infostatus;
        param.payStatus = payStatus;
        param.content = infocontent;
    }




    param.orderId = orderId;
    param.isAdopt = isAdopt;

    var value = JSON.stringify(param);
    treatData('order/auditOrder',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：用户付款前拒绝订单
 * 参数：orderId(订单id)
 * 作者：jame 参数已改变(jiph修改160705)
 * 时间：2016-05-31 15:41
 ******************************************************************************/
function cancelWithoutRefund(orderId,infotype,infostatus,payStatus,infocontent,fn){
    if(!orderId){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('790782b4a006034bcb0ee60fb94526f2')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!infotype){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('e6f8a6b01e7aae89795387491071ec27')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!infostatus){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('45996d39197f18c3af493abca3a1d3d1')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!payStatus){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('45996d39197f18c3af493abca3a1d3d1')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }
    }
    //if(!infocontent){
    //    var data={
    //        status:{
    //            status_code:-1,
    //            status_reason:'取消原因不能为空'
    //        }
    //    };
    //    if(fn)
    //    {
    //        fn(data);
    //        return;
    //    }
    //}

    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.orderId = orderId;
    param.type = infotype;
    param.status = infostatus;
    param.payStatus = payStatus;
    param.content = infocontent;



    var value = JSON.stringify(param);
    treatData('order/cancelWithoutRefund',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：用户付款后拒绝订单
 * 参数：orderId(订单id)
 * 作者：jame（参数已修改 jiph 160705）
 * 时间：2016-05-31 15:41
 ******************************************************************************/
function cancelAfterPay(orderId,infotype,infostatus,payStatus,infocontent,fn){
    if(!orderId){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('790782b4a006034bcb0ee60fb94526f2')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!infotype){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('e6f8a6b01e7aae89795387491071ec27')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!infostatus){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('45996d39197f18c3af493abca3a1d3d1')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!payStatus){
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('45996d39197f18c3af493abca3a1d3d1')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }
    }
    //if(!infocontent){
    //    var data={
    //        status:{
    //            status_code:-1,
    //            status_reason:'取消原因不能为空'
    //        }
    //    };
    //    if(fn)
    //    {
    //        fn(data);
    //        return;
    //    }
    //}

    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.orderId = orderId;
    param.type = infotype;
    param.status = infostatus;
    param.payStatus = payStatus;
    param.content = infocontent;

    var value = JSON.stringify(param);
    treatData('order/cancelAfterPay',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：获取国家级地址
 * 作者：jame
 * 时间：2016-05-25 11:49
 ******************************************************************************/
function getCountryList(fn){
    treatData('location/getCountryList',null,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

function getCountryList2(fn){
    treatData('location/getCountryList',null,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：获取省级地址
 * 参数：countryId(国家id) fn(回调函数)
 * 作者：jame
 * 时间：2016-05-25 11:49
 ******************************************************************************/
function getProvinceByCountry(countryId,fn){
    if(!countryId){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('d5c2630427087aa79ce788bd522e4a07');
        if(fn){
            fn(status);
        }
        return;
    }
    var param = {
        countryId:countryId
    };
    var value = JSON.stringify(param);
    treatData('location/getProvinceByCountry',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：获取城市地址
 * 参数：provinceId(省id) fn(回调函数)
 * 作者：jame
 * 时间：2016-05-26 09:06
 ******************************************************************************/
function getCityByProvince(provinceId,fn){
    if(!provinceId){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('45d6752f1c95cd61ea07ea2d8ec7998c');
        if(fn){
            fn(status);
        }
        return;
    }
    var param = {
        provinceId:provinceId
    };
    var value = JSON.stringify(param);
    treatData('location/getCityByProvince',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：获取乡镇地址
 * 参数：cityId(乡镇id) fn(回调函数)
 * 作者：jame
 * 时间：2016-05-26 09:06
 ******************************************************************************/
function getDistrictByCity(cityId,fn){
    if(!cityId){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('45d6752f1c95cd61ea07ea2d8ec7998c');
        if(fn){
            fn(status);
        }
        return;
    }
    var param = {
        cityId:cityId
    };
    var value = JSON.stringify(param);
    treatData('location/getDistrictByCity',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/*******************************************************************************
 * 功能：获取用户信息
 * 参数：yyoh userId fn(回调函数)
 * 作者：pwz
 * 时间：2016-05-26 14:55
 ******************************************************************************/
function getUserInfoById(yyoh,userId,fn){
    if(!userId ||!yyoh){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('81d710198e003c16a055621010eee957');
        if(fn){
            fn(status);
        }
        return;
    }
    var param = {
        yyoh:yyoh,
        userId:userId,
        attrList:["*"]
    };
    var value = JSON.stringify(param);
    treatData('userInfo/getUserInfoById',value,function(data,url){
        if(fn){
            fn(data,url);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/*******************************************************************************
 * 功能：用户添加兴趣爱好
 * 参数：yyoh userId fn(回调函数)
 * 作者：pwz
 * 时间：2016-05-26 21:33
 ******************************************************************************/
function addUserInterest(yyoh,userId,title,fn){
    if(!userId ||!yyoh){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('81d710198e003c16a055621010eee957');
        if(fn){
            fn(status);
        }
        return;
    }
    var param = {
        yyoh:yyoh,
        userId:userId,
        title:title
    };
    var value = JSON.stringify(param);
    treatData('userInfo/addUserInterest',value,function(data,url){
        if(fn){
            fn(data,url);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/*******************************************************************************
 * 功能：验证用户邮箱信息
 * 参数：yyoh userId fn(回调函数)
 * 作者：pwz
 * 时间：2016-05-27 10:00
 ******************************************************************************/
function setUserEmail(yyoh,userId,email,fn){
    if(!userId ||!yyoh){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('81d710198e003c16a055621010eee957');
        if(fn){
            fn(status);
        }
        return;
    }
    var param = {
        yyoh:yyoh,
        userId:userId,
        email:email
    };
    var value = JSON.stringify(param);
    treatData('userInfo/setUserEmail',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/*******************************************************************************
 * 功能：修改用户信息
 * 参数：yyoh userId email fn(回调函数)
 * 作者：pwz
 * 时间：2016-05-27 10:18
 ******************************************************************************/
function editUserInfo(opt,fn){
    var opt = opt;
    if(!opt.userId ||!opt.yyoh){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('81d710198e003c16a055621010eee957');
        if(fn){
            fn(status);
        }
        return;
    }
    var param = {
        yyoh    : opt.yyoh,
        userId  : opt.userId,
        attrValueList : {
            email:opt.email,
            nickName:   opt.nickName,
            sex     : opt.sex,
            birthday: opt.birthday,
            email   : opt.email,
            trueName: opt.trueName,
            levelId1: opt.levelId1,
            levelId2: opt.levelId2,
            levelId3: opt.levelId3,
            Profession: opt.joblevelId2,
            school  : opt.school,
            wechatId: opt.wechatId,
            resume  : opt.resume,
            interestIds: opt.interestIds
        }
    };
    var myDate = new Date();
    var value = JSON.stringify(param);
    treatData('userInfo/editUserInfo',value,function(data){
        if(fn){
            fn(data);
        }
    });
}

/*******************************************************************************
 * 功能：获取用户的红包列表
 * 参数：role(用户角色) page(当前页,第一页为1) pageSize(每页个数) typeNum(货币类型) port(接口名称)
 * 作者：pwz
 * 时间：2016-05-30 11:23
 ******************************************************************************/
function getCouponList(role,page,pageSize,typeNum,port,index,fn){
    if(!role){
        role = 1;
    }
    if(!page){
        page = 1;
    }
    if(!pageSize){
        pageSize = 10;
    }
    if(!typeNum){
        typeNum = publicMethods.getBuyerCurrency;
    }
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.role = role;
    var page = page;
    var range = {};
    range.pageSize = pageSize;
    range.page = page-1;
    param.range = range;
    param.typeNum = typeNum;
    var value = JSON.stringify(param);
    treatData('coupon/'+port,value,function(data){
        if(fn){
            range.page++;
            fn(data,range,index);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：获取订单详情
 * 参数：role(用户角色) page(当前页,第一页为1) pageSize(每页个数) typeNum(货币类型) port(接口名称)
 * 作者：pwz
 * 时间：2016-05-30 11:23
 ******************************************************************************/
function getOrderInfoById(isTypeNum,fn){
    var param = {};
    param.yyoh = $.cookie("yyoh");
    param.userId = $.cookie("id");
    param.orderId = $('#orderId').val();
    param.isCurrency = '1';
    if(isTypeNum){
        param.typeNum = publicMethods.getBuyerCurrency();
    }
    var value = JSON.stringify(param);
    treatData('order/getOrderInfoById',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}


/*******************************************************************************
 * 功能：获取用户的收藏列表
 * 参数：page(页码)  pageSize(每页个数)
 * 作者：jiph
 * 时间：2016-05-30 15:18
 ******************************************************************************/
function getWishList(page,pageSize,fn){
    if(!page){
        page = 1;
    }
    if(!pageSize){
        pageSize = 10;
    }
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    var page = page;
    var range = {};
    range.pageSize = pageSize;
    range.page = page-1;
    param.range = range;
    var value = JSON.stringify(param);
    treatData('collect/getCollectListByUserId',value,function(data,url){
        if(fn){
            range.page++;
            fn(data,range);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：取消收藏
 * 参数：houseId(房源id)
 * 作者：jiph
 * 时间：2016-05-30 15:18
 ******************************************************************************/
function cancelWishList(houseId,fn){
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.houseId = houseId?houseId:'';
    var value = JSON.stringify(param);
    treatData('collect/cancelCollect',value,function(data,url){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}


/*******************************************************************************
 * 功能：获取用户的房源列表
 * 参数：houseStatus(房源id) page(当前页,第一页为1) pageSize(每页个数)
 * 作者：jiph
 * 时间：2016-05-30 15:18
 ******************************************************************************/
function getRoomList(houseStatus,page,pageSize,fn){
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    var range = {};
    range.pageSize = pageSize;
    range.page = page - 1;
    param.range = range;
    param.houseStatus = houseStatus;
    param.attrList = ['*'];
    var value = JSON.stringify(param);
    treatData('house/getHouseList',value,function(data,url){
        if(fn){
            fn(data,range);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        var data = {status: status};
        if(fn){
            fn(data);
        }
    });
}
/*******************************************************************************
 * 功能：房东搜索房源列表
 * 参数：houseKey(搜索关键字) onLineHouse(是否搜索线上房源) page(当前页,第一页为1) pageSize(每页个数) ownerId(如果存在则搜索的是该房东的房源否则是自己的房源)
 * 作者：dy
 * 时间：2016-05-30 15:18
 ******************************************************************************/
function getSearchRoomList(houseKey,onLineHouse,page,pageSize,fn,ownerId) {
	var param = {};
	param.yyoh = $.cookie('yyoh');
	param.userId = $.cookie('id');
	var range = {};
	range.pageSize = pageSize;
	range.page = page - 1;
	param.range = range;
	param.keyWord = houseKey;
	param.onLineHouse = onLineHouse;
	param.typeNum = $.cookie('buyer_currency') || 1;
	param.attrList = ['*'];
	if(ownerId){
	    param.ownerId = ownerId;
    }
	var value = JSON.stringify(param);
	treatData('house/searchMyHouse',value,function(data,url){
		if(fn){
			fn(data,range,'search');
		}
	},function(){
		var status = {};
		status.status_code = -1;
		status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
		if(fn){
			fn(status);
		}
	});
}

/*******************************************************************************
 * 功能：房东订单列表、房东订单详情修改价格
 * 参数：orderId(订单id) modifiedPrice(新价格) minPrice(允许的最低价格) maxPrice(允许的最高价格)
 * 作者：jiph
 * 时间：2016-06-02 14:22
 ******************************************************************************/
function ModifyPrice(orderId,modifiedPrice,minPrice,maxPrice,fn){
    var param = {};
    param.yyoh = $.cookie("yyoh");
    param.userId = $.cookie("id");
    param.orderId =orderId;
    if(!orderId)
    {
        $('.error').html($.i18n.prop('16ec412dd079deddc57bcb2349fa88b0')).css('display','block');
        return;
    }
    var symbol = publicMethods.getCurrencySymbol();
    if(Math.round(modifiedPrice)<Math.round(minPrice))
    {
        $('.error').html($.i18n.prop('04a8efb8c25dd2d008f9996c2b82e7bb')+symbol+Math.round(minPrice)).css('display','block');
        return;
    }
    if(Math.round(modifiedPrice)>Math.round(maxPrice))
    {
        $('.error').html($.i18n.prop('02283bf3d3f27b74e3030e554be9d71a')+symbol+Math.round(maxPrice)).css('display','block');
        return;
    }
    var back = verification.money(modifiedPrice);
    if(back.status_code!=0)
    {
        $('.error').html(back.status_reason).css('display','block');
        return;
    }
    param.modifiedPrice =modifiedPrice;
    param.typeNum = publicMethods.getBuyerCurrency();
    var value = JSON.stringify(param);
    treatData('order/setOrderPrice',value,function(data,url){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}


/*******************************************************************************
 * 功能：获取当天各币种汇率
 * 参数： fn(回调函数)
 * 作者：jame
 * 时间：2016-05-25 00:48
 ******************************************************************************/
function getRates(fn){
    var param = {};
    var value = JSON.stringify(param);
    treatData('exchangeRate/getAllCurrencyList',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：获取行业种类
 * 作者：gyf
 * 时间：2016-06-02
 ******************************************************************************/

function getIndustryList(fn){
    treatData('userInfo/getUserProfessionWeb',null,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：获取职业种类
 * 参数：industryId(行业id) fn(回调函数)
 * 作者：gyf
 * 时间：2016-06-02
 ******************************************************************************/
function getJobByIndustryId(industryId,fn){
    if(!industryId){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('a04c9d3fccdf2a6afb37ba194230e0f0');
        if(fn){
            fn(status);
        }
        return;
    }
    var param = {
        industryId:industryId
    };
    var value = JSON.stringify(param);
    treatData('userInfo/getUserProfessionWeb',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************************
 * 功能：查询货币以及设定货币
 * 参数：fn(回调函数)
 * 作者：jiph
 * 时间：2016-06-08 15:54
 ******************************************************************************/
function getAllCurrencyList(fn){
    treatData('exchangeRate/getAllCurrencyList','',function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}



/*******************************************************************************
 * 功能：获取房源的出租状况
 * 参数：houseId(房源id) fn(回调函数)
 * 作者：jiph
 * 时间：2016-06-20
 ******************************************************************************/
function getHouseInfobyId(houseId,fn){
    if(!houseId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('7927923cb288c52e10377f67ff189c8d')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    //invalidDate 已经出租出去的
    //invalidChooseDate 房东自己设置的不可租的
    //minNights 最少住往天数

    var param = {
        houseId:houseId,
        realUserId:($.cookie('id')?$.cookie('id'):0),
        attrList:["invalidDate","invalidChooseDate","minNights"]
    };
    var value = JSON.stringify(param);
    treatData('house/getHouseInfo',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}


/*******************************************************************************
 * 功能：获取房源的价格信息
 * 参数：houseId(房源id) fn(回调函数)
 * 作者：jiph
 * 时间：2016-06-20
 ******************************************************************************/
function getHouseCalendar(houseId,fn){
    if(!houseId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('7927923cb288c52e10377f67ff189c8d')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    var param = {};
    param.houseId = houseId;
    param.isCurrency = '1';
    param.typeNum = $.cookie("buyer_currency");
    var value = JSON.stringify(param);

    treatData('houseCalendar/getHouseCalendar',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}





/*******************************************************************************
 * 功能：获取首页热门景点切换列表
 * 参数：fn(回调函数)
 * 作者：jiph
 * 时间：2016-06-27
 ******************************************************************************/
function getWebHomePageHouseList(level,levelId,fn){
    if(!level)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('8a359c7ef8546c36c06a4374ed6b5659')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!levelId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('114ea9a1c1272bb567e32d682acc2b73')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    var cookdata=$.cookie("buyer_currency");
    var typeNum = cookdata?cookdata:1;
    var param = {};
    param.level = level;
    param.levelId = levelId;
    param.typeNum = typeNum;
    var value = JSON.stringify(param);

    treatData('houseWeb/getWebHomePageHouseList',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}


/*******************************************************************************
 * 功能：获取首页专题切换列表
 * 参数：subjectId（专题列表）fn(回调函数)
 * 作者：jiph
 * 时间：2016-06-27
 ******************************************************************************/
function getHomePageThemeList(subjectId,fn){
    if(!subjectId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('8a359c7ef8546c36c06a4374ed6b5659')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    var param = {};
    param.subjectId = subjectId;
    var value = JSON.stringify(param);

    treatData('houseWeb/getHomePageThemeList',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}


//兑换
/*******************************************************************************
 * 功能：获取首页专题切换列表
 * 参数：subjectId（专题列表）fn(回调函数)
 * 作者：jiph
 * 时间：2016-06-27
 ******************************************************************************/
function exchangePacket(code,fn){
    if(!code)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('1d01f360f00b8fb494dacc2f38f738df')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');

    param.code = code;
    var value = JSON.stringify(param);

    treatData('coupon/getCouponByCode',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}



/*******************************************************************************
 * 功能：提交预订信息
 * 参数：subjectId（专题列表）fn(回调函数)
 * 作者：jiph
 * 时间：2016-06-27
 ******************************************************************************/
function orderSubmit(peopleNum,checkin,checkout,houseId,couponId,airportTransferList,insurance,selectCustomerId,RatePlanID,fn){
    if(!peopleNum)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('89641e3b949c1ba6db122dc06e15e7b1')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!checkin)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('29b39eb8a68e5717b0702639075c2c6f')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!checkout)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('bf673e884c59df7619861fd4d52c4b79')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!houseId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('8f626c0bd6c2cb067925525f61efd265')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    var typeNum = 1;
    if ($.cookie('buyer_currency')) {
        typeNum = $.cookie('buyer_currency');
    }
    var param = {
        yyoh: $.cookie('yyoh'),
        userId: $.cookie('id'),
        peopleNum: peopleNum,
        startDate: checkin,
        endDate: checkout,
        typeNum: typeNum,
        houseId: houseId,
        couponId: couponId,
	    RatePlanID: RatePlanID
    };
    if(JSON.stringify(airportTransferList)!='[]')
    {
        param.airportTransferList = airportTransferList;
    }

    if(JSON.stringify(insurance)!='[]')
    {
        param.insurance = insurance;
    }

    if(selectCustomerId != ''){
        param.checkInList = selectCustomerId;
    }

    var value = JSON.stringify(param);
    treatData('order/createOrderByServer', value, function (data,url) {
        if(fn){
            fn(data,url);
        }
    },function(){
        var data = {};
        data.status = {};
        data.status.status_code = -1;
        data.status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(data);
        }
    });




}
/*******************************************************************************
 * 功能：提交预订信息  酒店信息提交
 * 参数：subjectId（专题列表）fn(回调函数)
 * 作者：jiph
 * 时间：2016-06-27
 ******************************************************************************/
function orderHotelSubmit(peopleNum,checkin,checkout,hotelId,roomId,planId,roomNum,couponId,airportTransferList,insurance,selectCustomerId,RatePlanID,fn){
    if(!peopleNum)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('89641e3b949c1ba6db122dc06e15e7b1')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!checkin)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('29b39eb8a68e5717b0702639075c2c6f')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!checkout)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('bf673e884c59df7619861fd4d52c4b79')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!hotelId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('8f626c0bd6c2cb067925525f61efd265')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    var typeNum = 1;
    if ($.cookie('buyer_currency')) {
        typeNum = $.cookie('buyer_currency');
    }
    var param = {
        yyoh: $.cookie('yyoh'),
        userId: $.cookie('id'),
        peopleNum: peopleNum,
        startDate: checkin,
        endDate: checkout,
        typeNum: typeNum,
        hotelId: hotelId,
        couponId: couponId,
	    RatePlanID: RatePlanID,
        roomId:roomId,
        planId: planId,
        roomNum: roomNum,
    };
    if(JSON.stringify(airportTransferList)!='[]')
    {
        param.airportTransferList = airportTransferList;
    }

    if(JSON.stringify(insurance)!='[]')
    {
        param.insurance = insurance;
    }

    if(selectCustomerId != ''){
        param.checkInList = selectCustomerId;
    }

    var value = JSON.stringify(param);
    treatData('hotelOrder/submit', value, function (data,url) {
        if(fn){
            fn(data,url);
        }
    },function(){
        var data = {};
        data.status = {};
        data.status.status_code = -1;
        data.status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(data);
        }
    });




}


/***根据入往日期、退房日期、入住人数，获取是否有可用红包 20160702
 *houseId（房源id），peopleNum（入住人数），startDate（入住日期），endDate（退房日期）,fn(回调函数)
 * **/
function getUsableCoupon(houseId,peopleNum,startDate,endDate,airportTransferList,fn){

    if(!houseId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('9925a1efea9778a876768dd031d21991')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!peopleNum)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('89641e3b949c1ba6db122dc06e15e7b1')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!startDate)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('29b39eb8a68e5717b0702639075c2c6f')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!endDate)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('f8f06564500ff20c93ab4ca7c48b5788')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    var typeNum = 1;
    if ($.cookie('buyer_currency')) {
        typeNum = $.cookie('buyer_currency');
    }
    var param = {};

    if(JSON.stringify(airportTransferList)!='[]')
    {
        param.airportTransferList = airportTransferList;
    }
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.houseId = houseId;
    param.peopleNum = peopleNum;
    param.startDate = startDate;
    param.endDate = endDate;
    param.typeNum = typeNum;

    var value = JSON.stringify(param);
    treatData('coupon/getUsableCoupon',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });

}

/*******************************************************************************
 * 功能：用户拒绝预订单原因提示信息
 * 参数：yyoh userId fn(回调函数)orderId(订单id)
 * 作者：jame 参数改变，重新修改
 * 时间：2016-05-31 15:41
 ******************************************************************************/
//function cancelInfoMessage(infoType,infoRole,fn){
//    var param = {};
//    param.yyoh = $.cookie('yyoh');
//    param.userId = $.cookie('id');
//    param.type = infoType;
//    param.role = infoRole;
//    var value = JSON.stringify(param);
//    treatData('order/getOrderCancelReason',value,function(data,url){
//        if(fn){
//            fn(data);
//        }
//    },function(){
//        var status = {};
//        status.status_code = -1;
//        status.status_reason = '访问远程连接失败';
//        if(fn){
//            fn(status);
//        }
//    });
//}


function cancelInfoMessage(infoRole,infostatus,payStatus,fn){
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.status = infostatus;
    param.role = infoRole;
    param.payStatus = payStatus;
    var value = JSON.stringify(param);
    treatData('order/getOrderCancelReason',value,function(data,url){
        if(fn){
            fn(data);
        }
    },function(){

        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('8769325cede51293d71b72d023adf0b9')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }
    });
}
// 获取退订政策以及 退款计算的数据展示取消订单页面
function getOrderRefundInfo(orderId,fn){
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.orderId = orderId;

    var value = JSON.stringify(param);
    treatData('order/getOrderRefundInfo',value,function(data,url){
        if(fn){
            fn(data);
        }
    },function(){

        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('8769325cede51293d71b72d023adf0b9')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }
    });
}
/*******************************************************************************
 * 功能：房东订单修改价格调用判断是否为国外房源
 * 参数：orderId(订单id) typeNum(当前货币类型)
 * 作者：line.p
 * 时间：2016-07-19 17:22
 ******************************************************************************/
function getPriceRangeAction(orderId,typeNum,totalPrice,commissionFee,allTechFee,airportTransferFee,totalHouseFee,fn){
    var param = {
        yyoh:$.cookie("yyoh"),
        userId:$.cookie("id"),
        orderId:orderId,
        typeNum: typeNum
    };
    var value = JSON.stringify(param);
    treatData('order/getPriceRange',value,function(data,url){
        if(fn){
            fn(data,totalPrice,commissionFee,allTechFee,airportTransferFee,totalHouseFee,orderId);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/*******************************************************************
 * 修改价格弹窗
 * @param data
 * @param totalPrice  房价或修改后的房价
 * @param commissionFee  房东服务费
 * @param allTechFee   房客服务费
 * @param orderId  订单号
 */
function getPriceRange (data,totalPrice,commissionFee,allTechFee,airportTransferFee,totalHouseFee,orderId) {
	totalPrice = Number(totalPrice);
	commissionFee = Number(commissionFee);
	allTechFee = Number(allTechFee);
	airportTransferFee = Number(airportTransferFee);
	totalHouseFee = Number(totalHouseFee);
    if(data.status.status_code == 0){
        if(data.result.Range){
            if(data.result.Range.isDisplayDetail){ //国外房源 else 为国内房源
                var currency_symbol = $.cookie("currency_symbol");
                var oError = $('.addPrice').next(".error");
                $('.abroad-section').remove();

                var abroadSection = '<div class="abroad-section">' +
                    '<span class="price-tips">' + $.i18n.prop('9d68f5a000c173b337d1ae92275bfee9') + '</span><span class="price-tips">* 实际收入可能由于汇率原因和预计收入有偏差</span>' +
                    '<div class="price-show">' +
                    '<strong class="price-show-tit"><p>' + $.i18n.prop('963ffde7329405e7cac7589a40c39b42') + '</p><span><i>' + currency_symbol +'</i>' + Math.round(totalPrice-allTechFee-commissionFee) +'</span></strong>' +
                    '<strong class="price-show-li orderTotal"><p>' + $.i18n.prop('c3c8943204e98e58a5ed426dc98f2b4a') + '</p><span><i>' + currency_symbol +'</i>' + Math.round(totalHouseFee) +'</span></strong>' +
                    '<strong class="price-show-li"><p>' + $.i18n.prop('43d3af4ec8cf47557bc525388a5659a5') + '</p><span><i>' + currency_symbol +'</i>' + Math.round(airportTransferFee) +'</span></strong>' +
                    '<strong class="price-show-li guestBrokerage"><p>' + $.i18n.prop('d3df0c4150b1247dcb19be32e7a6add0') + '</p><span><i>' + currency_symbol +'</i>' + Math.round(allTechFee) +'</span></strong>' +
                    '<strong class="price-show-li homeBrokerage"><p>' + $.i18n.prop('f55dd9f0dc77eb0235d5460aa16bdb6d') + '</p><span><i>' + currency_symbol +'</i>' + Math.round(commissionFee)+'</span></strong>' +
                    '</div></div>';

                oError.after(abroadSection);


                $('.addPrice').on('input propertychange',function(){
                    var numRe =  /^[0-9]*$/,
                        sRe = /^\s*$/g,
                        str = $(this).val(),
                        oError = $(this).parent().find('.error');
                    var totalpricenew=totalHouseFee;
                    if(str == ''|| sRe.test(str)){

                    }else{
                        totalpricenew=str;
                    }

                    if(numRe.test(totalpricenew)) {
                        try{
	                        totalpricenew = Number(totalpricenew);
                            var rate = totalpricenew/totalHouseFee,
                                allTechFeenew = allTechFee*rate,
                                commissionFeenew = (commissionFee-airportTransferFee/10) * rate+airportTransferFee/10,
                                allIncomenew = totalpricenew+airportTransferFee-allTechFeenew-commissionFeenew;

                            $('.price-show-tit span').html('<i>'+ currency_symbol +'</i>'+ Math.round(allIncomenew));
                            $('.orderTotal span').html('<i>'+ currency_symbol +'</i>'+ totalpricenew);
                            $('.guestBrokerage span').html('<i>'+ currency_symbol +'</i>'+Math.round(allTechFeenew));
                            $('.homeBrokerage span').html('<i>'+ currency_symbol +'</i>'+Math.round(commissionFeenew));
                        }
                        catch(e){}
                    }else{

                        oError.html($.i18n.prop('a0cd9d87b114a20072a9fbeee002130a'));
                        dropprompt(oError,800);
                    }

                })
            }
            new modifyPriceFn(Math.round(totalHouseFee),orderId,data.result.Range.loweast,data.result.Range.higheast);
        }
    }
}

function dropprompt(obj,time){
    obj.slideDown();
    setTimeout(function(){obj.slideUp();}, time);
}

/*******************************************************************************
 * 功能：房东修改时，获取实时的价格变动
 * 参数：orderId(订单id) typeNum(当前货币类型)
 * 作者：line.p
 * 时间：2016-07-19 17:22
 ******************************************************************************/
function getPriceListInSetOrderPriceAction(orderId,modifiedPrice,fn){

    if(!orderId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('a0c76224b8a7acd5b30eb429238ce49d')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    var typeNum = 1;
    if ($.cookie('buyer_currency')) {
        typeNum = $.cookie('buyer_currency');
    }


    if(!modifiedPrice)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('335942287fb22b03edd1c56e77133a59')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    var param = {
        yyoh:$.cookie("yyoh"),
        userId:$.cookie("id"),
        modifiedPrice:modifiedPrice,
        orderId:orderId,
        typeNum: typeNum
    };
    var value = JSON.stringify(param);
    treatData('order/getPriceListInSetOrderPrice',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/***
 * 取消已发布的房源
 * houseId 房源id
 * jiph 0726
 * ***/
function cancelPublishHouse(houseId,fn){
    if(!houseId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('8f626c0bd6c2cb067925525f61efd265')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    var param = {
        yyoh:$.cookie("yyoh"),
        userId:$.cookie("id"),
        houseId:houseId
    };
    var value = JSON.stringify(param);
    treatData('house/cancelPublishHouse',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/***
 * 发布房源
 * houseId 房源id
 * ***/
function releaseOldHouse(houseId,fn){
    if(!houseId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('8f626c0bd6c2cb067925525f61efd265')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    var param = {
        yyoh:$.cookie("yyoh"),
        userId:$.cookie("id"),
        houseId:houseId,
	    attrValueList: {},
	    pictureList:{}
    };
    var value = JSON.stringify(param);
    treatData('house/releaseOldHouse',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/***
 * 取消二次审核
 * houseId 房源id
 * ***/
function cancelAuditHouse(houseId,fn){
	var param = {
		yyoh:$.cookie("yyoh"),
		userId:$.cookie("id"),
		houseId:houseId
	};
	var value = JSON.stringify(param);
	treatData('house/cancelDoubleAudit',value,function(data){
		if(fn){
			fn(data);
		}
	},function(){
		var status = {};
		status.status_code = -1;
		status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
		var data = {status: status};
		if(fn){
			fn(data);
		}
	});
}

/***
 * 获取验证码图片
 * jame 1111
 * ***/
function getSendVeriCodeForWeb(fn){
    treatData('veriCode/getSendVeriCodeForWeb','',function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}

/***
 * 获取验证码
 * jame 1111
 * ***/
function sendVeriCode(phone,prefixPhoneNum,psid,code,isNewUser,fn){
    var boo=false,reason='';
    if(!phone){
        reason = $.i18n.prop('8fde36d669c03587640e92f4681e0dac');
        boo = true;
    }
    if(!prefixPhoneNum){
        reason = $.i18n.prop('47b41a48b77d33951263bdc544952a0e');
        boo = true;
    }
    if(!psid){
        reason = $.i18n.prop('e6996d45e9028cb7386ce00b0e03e969');
        boo = true;
    }
    if(!code){
        reason = $.i18n.prop('8a4bac4cdcacea22152684cdbd4d3f99');
        boo = true;
    }
    if(boo){
        var data={
            status:{
                status_code:-1,
                status_reason:reason
            }
        };
        if(fn){
            fn(data);
            return;
        }
    }
    var param = {
        phone:phone,
        prefixPhoneNum:prefixPhoneNum,
        psid:psid,
        code:code,
        isNewUser:isNewUser
    }
    var value = JSON.stringify(param);
    treatData('veriCode/sendVeriCode',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/***
 * 获取验证码(无图片验证码)
 * ***/

function sendVeriCode_noimg(NSQRl1,FymXn2,IeYyFE3,zKF4){    var r5=false,EefATNhK6='';    if(!NSQRl1){        EefATNhK6 = '\u7535\u8bdd\u4e0d\u80fd\u4e3a\u7a7a';        r5 = true;    }    if(!FymXn2){        EefATNhK6 = '\u533a\u53f7\u4e0d\u80fd\u4e3a\u7a7a';        r5 = true;    }    if(r5){        var SqmsLzLe7={            status:{                status_code:-1,                status_reason:EefATNhK6            }        };        if(zKF4){            zKF4(SqmsLzLe7);            return;        }    }    var caYGGk8 = createTimeStamp(),        JdOV9 = randomString(),        ZeOKDO10 = eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('$["\\2\\0\\1"]($["\\2\\0\\1"](4+7+6)+5+3)',8,8,'x64|x35|x6d|JdOV9|NSQRl1|caYGGk8|IeYyFE3|FymXn2'.split('|'),0,{}));    var wINsPkB11 = {        phone:NSQRl1,        prefixPhoneNum:FymXn2,        isNewUser:IeYyFE3,        timestamp: caYGGk8,        nonce: JdOV9,        sign: ZeOKDO10    };    var Mmmg12 = JSON["\x73\x74\x72\x69\x6e\x67\x69\x66\x79"](wINsPkB11);    treatData('\x76\x65\x72\x69\x43\x6f\x64\x65\x2f\x73\x65\x6e\x64\x56\x65\x72\x69\x43\x6f\x64\x65',Mmmg12,function(vNY13){        if(zKF4){            zKF4(vNY13);        }    },function(){        var yyRfKVH14 = {};        yyRfKVH14["\x73\x74\x61\x74\x75\x73\x5f\x63\x6f\x64\x65"] = -1;        yyRfKVH14["\x73\x74\x61\x74\x75\x73\x5f\x72\x65\x61\x73\x6f\x6e"] = '\u8bbf\u95ee\u8fdc\u7a0b\u8fde\u63a5\u5931\u8d25';        var ZJW15 = {status: yyRfKVH14};        if(zKF4){            zKF4(ZJW15);        }    });}

/**
 * 计算浏览器滚动条宽度(如果有滚动条返回滚动条宽度否则返回0)
 * @returns {number|*}
 */
function getScrollbarWidth() {
    if(document.documentElement.offsetHeight > document.documentElement.clientHeight){
        var oP = document.createElement('p'),
            styles = {
                width: '100px',
                height: '100px',
                overflowY: 'scroll'
            }, i, scrollbarWidth;
        for (i in styles) oP.style[i] = styles[i];
        document.body.appendChild(oP);
        scrollbarWidth = oP.offsetWidth - oP.clientWidth;
        oP.remove();
        return scrollbarWidth;
    }else{
        return 0;
    }
}
/**
 *  日本垃圾分类弹窗开启和关闭
 */
function openInfoboxByJapanGarbage(classname){
    $('.one-infobox-japangarbage.'+classname).parents('.one-shade-japangarbage').show();
    $('body').css({'overflow':'hidden','padding-right':getScrollbarWidth()});

	$('.infoboxCloseBtn').click(function () {
		$('.one-shade-japangarbage').hide();
		$('body').css({'overflow':'auto','padding-right':'0'});
	});
}
/**
 * 周租弹窗开启和关闭
 */
function openInfoboxByWeeklyRentContract(classname){
    $('.one-infobox-weeklyRent.'+classname).parents('.one-shade-weeklyRent').show();
    $('body').css({'overflow':'hidden','padding-right':getScrollbarWidth()});

	$('.infoboxCloseBtn').click(function () {
		$('.one-shade-weeklyRent').hide();
		$('body').css({'overflow':'auto','padding-right':'0'});
	});
}
/**
 * 特殊退订政策弹窗开启和关闭
 */
function openInfoboxBySpecialPolicyBox(classname){
    $('.one-infobox-specialPolicyBox.'+classname).parents('.one-shade-specialPolicyBox').show();
    $('body').css({'overflow':'hidden','padding-right':getScrollbarWidth()});

	$('.infoboxCloseBtn').click(function () {
		$('.one-shade-specialPolicyBox').hide();
		$('body').css({'overflow':'auto','padding-right':'0'});
	});
}
/**
 * 全站信息弹窗开启和关闭
 */
function openInfobox(classname){
    $('.one-infobox.'+classname).parents('.one-shade').show();
    $('body').css({'overflow':'hidden','padding-right':getScrollbarWidth()});

	$('.infoboxCloseBtn').click(function () {
		$('.one-shade').hide();
		$('body').css({'overflow':'auto','padding-right':'0'});
	});
}
/**
 * PC端的提示框/模态框
 * @param ifmodal 是否为模态框 value：0/1（提示框/模态框）
 * @param title 标题
 * @param content 内容
 * @param fn1 提示框的确定回调函数/提示框的确定回调函数
 * @param fn2 模态框的取消回调函数
 * @param text1 模态框的取消文字/提示框的确定文字
 * @param text2 模态框的确定文字
 */
function pcAlert(ifmodal,title,content,fn1,fn2,text1,text2) {
	text1 = text1 || $.i18n.prop('0bb693fe216f2459916db6572698a21b');
	text2 = text2 || $.i18n.prop('b96cff383d05c959b7955929b87eb6e3');
    if(ifmodal == 1){
        // 模态框
        var contentStyle = title ? '' : 'font_20'; //没有title则内容字号为20

        var str = '<div class="shadebox pcAlert" style="display:block;height: 100%;"></div>';
        str += '<div class="pcAlert align_c one-modal" id="oneModal">\n\
                        <div class="pL20 pR20">\n\
                            <h3 class="mT25 mB0">'+title+'</h3>\n\
                            <div class="mT35 mB35 '+contentStyle+'">'+content+'</div>\n\
                        </div>\n\
                        <div class="lineH50 font_16" style="border-top: 1px solid #d8d8d8;">\n\
                            <div class="fl width50P closebox cursor_po" style="border-right: 1px solid #d8d8d8;">'+text1+'</div>\n\
                            <div class="fl width50P okbtn color_f84340 cursor_po">'+text2+'</div>\n\
                        </div>\n\
                 </div>';

        $('body').append(str).css({'overflow':'hidden','padding-right':getScrollbarWidth()});
        $('#oneModal').css('top',$(window).height()/2-$('#oneModal').height()/2);
        $('#oneModal').css('left',$(window).width()/2-$('#oneModal').width()/2);
        $('.closebox').click(fn1?fn1:closeAlert);
        $('.okbtn').click(fn2?fn2:closeAlert);
    }
    if(ifmodal == 0){
        // 提示框
    }
    if(ifmodal == 2){
        //日历设置-设置周末价格
	    var str = '<div class="shadebox pcAlert" style="display:block;height: 100%;"></div>';
	    str += '<div class="pcAlert align_c one-modal weekend-price-modal" id="oneModal">\n\
                        <div class="pL20 pR20">\n\
                            <h3 class="mT25 mB0 font_20">'+title+'</h3>\n\
                            <div class="mT35 mB35 pL20 align_l">'+content+'</div>\n\
                        </div>\n\
                        <div class="lineH50 font_16" style="border-top: 1px solid #d8d8d8;">\n\
                            <div class="fl width50P closebox cursor_po" style="border-right: 1px solid #d8d8d8;">'+text1+'</div>\n\
                            <div class="fl width50P okbtn color_f84340 cursor_po">'+text2+'</div>\n\
                        </div>\n\
                 </div>';

	    $('body').append(str).css({'overflow':'hidden','padding-right':getScrollbarWidth()});
	    $('#oneModal').css('top',$(window).height()/2-$('#oneModal').height()/2);
	    $('#oneModal').css('left',$(window).width()/2-$('#oneModal').width()/2);
	    $('.closebox').click(fn1?fn1:closeAlert);
	    $('.okbtn').click(fn2?fn2:closeAlert);
    }
    if(ifmodal == 3){
        var startDate = title;
        var endDate = content;
        var daysArry = text1;
        var currency = text2;
        //日历设置-设置特殊价格
        var durationContent = '';
        for(var i=0; i<startDate.length; i++){
            if(i == 0){
	            durationContent += '<div class="color_484848 pr">\n' +
		            '                   <input type="text" readonly class="datebox" name="checkins" placeholder="yyyy-mm-dd" value="'+dataChangeForUse(startDate[i])+'" data-time="'+startDate[i]+'"/>\n' +
		            '                   <p class="align_c lineH35">'+$.i18n.prop('db86d90ed8b2629e557a835f87c4a921')+'</p>\n' +
		            '                   <input type="text" readonly class="datebox" name="checkouts" placeholder="yyyy-mm-dd" value="'+dataChangeForUse(endDate[i])+'" data-time="'+endDate[i]+'"/>\n' +
		            '               </div>';
            }else{
	            durationContent += '<div class="color_484848 pr mT12">\n' +
		            '                   <input type="text" readonly class="datebox" name="checkins" placeholder="yyyy-mm-dd" value="'+dataChangeForUse(startDate[i])+'" data-time="'+startDate[i]+'"/>\n' +
		            '                   <p class="align_c lineH35">'+$.i18n.prop('db86d90ed8b2629e557a835f87c4a921')+'</p>\n' +
		            '                   <input type="text" readonly class="datebox" name="checkouts" placeholder="yyyy-mm-dd" value="'+dataChangeForUse(endDate[i])+'" data-time="'+endDate[i]+'"/>\n' +
		            '                   <span class="delete-icon">—</span>\n' +
		            '               </div>';
            }
        }
	    var str = '<div class="shadebox pcAlert" style="display: block;">\n' +
		    '    <div class="pcAlert bgcolor_fff weekend-price-modal" style="width: 420px;margin: 150px auto;border-radius: 5px;">\n' +
		    '      <div class="pL40 pR40 pT10 mB60 pr">\n' +
		    '        <div class="mB12 mT30 color_484848">\n' +
		    '            <span>'+$.i18n.prop('880b0b5cd7a5c13b5f7f0f0e1103aba5')+'</span>\n' +
		    '            <p class="fr color_f84340 cursor_po" id="addDuration" style="position:relative;"><span class="plus-icon">+</span>'+$.i18n.prop('3190894ca1352fd4747562af8373e29b')+'</p>\n' +
		    '        </div>\n' +
            '        <div class="durationWrap pr">' + durationContent + '<p class="date-error-info pa"></p></div>\n' +
		    '        <p class="mB12 mT30 color_484848">'+$.i18n.prop('17f13f025f3b9c44f4756441822bd9f7')+'</p>\n' +
		    '        <div class="pr"><span class="currency">'+currency+'</span><input type="text" name="price" value=""/><p class="error-info pa"></p></div>\n' +
		    '        <p class="mB12 mT30 color_484848">'+$.i18n.prop('4aebf90b0300a7ceac60d1d14ae0f51e')+'</p>\n' +
		    '        <div class="checkbox-wrap pr clearfix" id="daySelect" style="width: 362px;margin-left: -11px;">\n' +
		    '            <label><input type="checkbox" name="" class="one_checkbox" value="all" '+(JSON.stringify(daysArry) == "[1,1,1,1,1,1,1]" ? 'checked="checked"' : '')+'"/>'+$.i18n.prop('a8b0c20416853bda54120bf19477ad11')+'<i style="visibility: hidden">一</i></label>\n' +
		    '            <label><input type="checkbox" name="weekday" class="one_checkbox" value="1" '+(daysArry[1] ? 'checked="checked"' : '')+'/>'+$.i18n.prop('5ce438210f58d2e52ba8fccd3d99cb67')+'</label>\n' +
		    '            <label><input type="checkbox" name="weekday" class="one_checkbox" value="2" '+(daysArry[2] ? 'checked="checked"' : '')+'/>'+$.i18n.prop('34e5216bc310f8c4db8fbfe772156237')+'</label>\n' +
		    '            <label><input type="checkbox" name="weekday" class="one_checkbox" value="3" '+(daysArry[3] ? 'checked="checked"' : '')+'/>'+$.i18n.prop('711d996d87638acb6b93552fca140942')+'</label>\n' +
		    '            <label><input type="checkbox" name="weekday" class="one_checkbox" value="4" '+(daysArry[4] ? 'checked="checked"' : '')+'/>'+$.i18n.prop('3df6af796b60302d6184ee1e02e090ab')+'</label>\n' +
		    '            <label><input type="checkbox" name="weekday" class="one_checkbox" value="5" '+(daysArry[5] ? 'checked="checked"' : '')+'/>'+$.i18n.prop('450ea3af464ff9f8a08600c0c1f7b82c')+'</label>\n' +
		    '            <label><input type="checkbox" name="weekday" class="one_checkbox" value="6" '+(daysArry[6] ? 'checked="checked"' : '')+'/>'+$.i18n.prop('1ae72f6826c2717962d123e8088116c2')+'</label>\n' +
		    '            <label><input type="checkbox" name="weekday" class="one_checkbox" value="0" '+(daysArry[0] ? 'checked="checked"' : '')+'/>'+$.i18n.prop('67b19578d0752ceb5bfc7abb46587f82')+'</label>\n' +
            '            <p class="day-error-info pa"></p>\n' +
		    '        </div>\n' +
		    '        <p class="mT30 color_484848">'+$.i18n.prop('3f970111c85acd6cd40dfa7bed23f5a6')+'</p>\n' +
		    '        <div class="radio-wrap clearfix">\n' +
		    '            <label><input type="radio" name="rentStatus" class="one_radio" value="1" checked="checked"/>'+$.i18n.prop('c368965bffb17e357673ef2f5061b5ae')+'</label>\n' +
		    '            <label><input type="radio" name="rentStatus" class="one_radio" value="0"/>'+$.i18n.prop('1f0b74d25193e07e7b1beb26309dc568')+'</label>\n' +
		    '        </div>\n' +
		    '      </div>\n' +
	        '      <div class="lineH50 font_16 align_c clearfix" style="border-top: 1px solid #d8d8d8;">\n' +
	        '          <div class="fl width50P closebox cursor_po" style="border-right: 1px solid #d8d8d8;">'+$.i18n.prop('0bb693fe216f2459916db6572698a21b')+'</div>\n' +
	        '          <div class="fl width50P okbtn color_f84340 cursor_po">'+$.i18n.prop('b96cff383d05c959b7955929b87eb6e3')+'</div>\n' +
	        '      </div>\n' +
		    '    </div>\n' +
		    '</div>';

        setTimeout(function(){
	        $('body').append(str).css({'overflow':'hidden','padding-right':getScrollbarWidth()});
	        $('.closebox').click(fn1?fn1:closeAlert);
	        $('.okbtn').click(fn2?fn2:closeAlert);
        },200);
    }
    function closeAlert() {
        $('.pcAlert').remove();
        $('body').css({'overflow':'auto','padding-right':0});
    }
}


/*******************************************************************************
 * 功能：获取用户的消息  --   看看列表
 * 参数：page(页码)  pageSize(每页个数)
 * 作者：xuanxiao
 * 时间：2017-06-15 15:18
 ******************************************************************************/
function getLookList(page,pageSize,fn){
    if(!page){
        page = 1;
    }
    if(!pageSize){
        pageSize = 10;
    }
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    var page = page;
    var range = {};
    range.pageSize = pageSize;
    range.page = page-1;
    param.range = range;
    param.type = '1';
    var value = JSON.stringify(param);
    treatData('pushMessage/getSessionHistoryList',value,function(data,url){
        if(fn){
            range.page++;
            fn(data,range);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/*******************************************************************************
 * 功能：获取用户的消息  --   通知列表
 * 参数：page(页码)  pageSize(每页个数)
 * 作者：xuanxiao
 * 时间：2017-06-15 15:18
 ******************************************************************************/
function getNotifyList(page,pageSize,fn){
    if(!page){
        page = 1;
    }
    if(!pageSize){
        pageSize = 10;
    }
    var param = {};
    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    var page = page;
    var range = {};
    range.pageSize = pageSize;
    range.page = page-1;
    param.range = range;
    param.type = '2';
    var value = JSON.stringify(param);
    treatData('pushMessage/getSessionHistoryList',value,function(data,url){
        if(fn){
            range.page++;
            fn(data,range);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
// 获取url 参数
function UrlSearch(){
    var name,value;
    var str=location.href; //取得整个地址栏
    var num=str.indexOf("?");
    str=str.substr(num+1); //取得所有参数

    var arr=str.split("&"); //各个参数放到数组里
    for(var i=0;i < arr.length;i++){
        num=arr[i].indexOf("=");
        if(num>0){
            name=arr[i].substring(0,num);
            value=arr[i].substr(num+1);
            this[name]=value;
        }
    }
}
/*****************
 * 明天日期
 * @param str eg:20170909
 */
function getTomorrow(str){
    var str = str.substr(0,4)+'/'+str.substr(4,2)+'/'+str.substr(6,2);
    var tomorrow = new Date(Date.parse(new Date(str)) +24*60*60*1000);

    var y = tomorrow.getFullYear();
    var m = tomorrow.getMonth()+1 < 10 ? '0'+(tomorrow.getMonth()+1) : tomorrow.getMonth()+1;
    var d = tomorrow.getDate() < 10 ? '0'+tomorrow.getDate() : tomorrow.getDate();
    return y+''+m+''+d;
}

/*******************************************************************************
 * 功能：订单押金的处理
 * 参数：typeNum(货币类型) orderId(订单号) deduction(扣除金额)
 *    role(用户角色 1是房东 2是房客) type(1/2/3)
 *    role=1 type=2 房东扣除押金  role=1 type=1 房东退换押金  role=1 type=3 房东申请客服介入
 *    role=2 type=2 房客拒绝扣除押金  role=2 type=1 房客同意扣除押金  role=2 type=3 房客申请客服介入
 *    reason(申请客服介入原因)   photos(照片)
 * 作者：xuanxiao
 * 时间：2017-08-24 10:24
 ******************************************************************************/
function checkOrderDepositByType(datas,fn){
    var param = {};
    param.yyoh = $.cookie("yyoh");
    param.userId = $.cookie("id");
    param.orderId = datas.orderId;
    param.role = datas.role;
    param.type = datas.type;
    if(datas.type == 2 && datas.role == 1) {
        param.deduction = datas.deduction;
        param.typeNum = datas.typeNum;
    }
    if(datas.type == 3) {
        param.reason = datas.reason;
        param.photos = datas.photos;
    }


    var value = JSON.stringify(param);
    treatData('order/checkOrderDeposit',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/*******************************************************************************
 * 功能：立即预订房源的时候检查是否还有房源可以预订
 * 参数：houseId 房源id   租房开始日期   租房结束日期
 * 作者：xuanxiao
 * 时间：2017-08-24 10:24
 ******************************************************************************/
function checkXZStockQueryHouse(datas,fn){
    var param = {};
    param.yyoh = $.cookie("yyoh");
    param.userId = $.cookie("id");
    param.houseId = datas.houseId;
    param.startDate = datas.startDate;
    param.endDate = datas.endDate;
    param.peopleNum = datas.peopleNum;

    var value = JSON.stringify(param);
    treatData('xiaozhu/xZStockQuery',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/**
 * 付款之前房源库存检查
 * @param orderId
 * @param fn
 */
function beforePayCheckStock(orderId,fn) {
    var param = {};
    param.yyoh = $.cookie("yyoh");
    param.userId = $.cookie("id");
    param.orderId = orderId;

    var value = JSON.stringify(param);
    treatData('orderCheck/beforePayCheck',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });
}
/**
 * 根据分数显示星级
 * @param score
 * @returns {string}
 */
function getCommentStar(score)
{
    var $str = '';

    if (score < 0.1) {
        $str = "/images/details/1.png";
    }
    if (score >= 0.1 && score < 0.6) {
        $str = "/images/details/2.png";
    }
    if (score >= 0.6 && score < 1.1) {
        $str = "/images/details/3.png";
    }
    if (score >= 1.1 && score < 1.6) {
        $str = "/images/details/4.png";
    }
    if (score >= 1.6 && score < 2.1) {
        $str = "/images/details/5.png";
    }
    if (score >= 2.1 && score < 2.6) {
        $str = "/images/details/6.png";
    }
    if (score >= 2.6 && score < 3.1) {
        $str = "/images/details/7.png";
    }
    if (score >= 3.1 && score < 3.6) {
        $str = "/images/details/8.png";
    }
    if (score >= 3.6 && score < 4.1) {
        $str = "/images/details/9.png";
    }
    if (score >= 4.1 && score < 4.6) {
        $str = "/images/details/10.png";
    }
    if (score >= 4.6) {
        $str = "/images/details/11.png";
    }
    return $str;
}
/* 随机数 */
function randomString() {
    /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
    var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
    var maxPos = chars.length;
    var pwd = '';
    for (var i = 0; i < 32; i++) {
        pwd += chars.charAt(Math.floor(Math.random() * maxPos));
    }
    return pwd;
}
/* 时间戳产生函数   */
function createTimeStamp(unit) {
    if(unit == 'ms'){
        return new Date().getTime() + ''
    }else{
        return parseInt(new Date().getTime() / 1000) + ''
    }
}
/*php urlencode*/
function urlencode(clearString)
{
    var output = '';
    var x = 0;

    clearString = utf16to8(clearString.toString());
    var regex = /(^[a-zA-Z0-9-_.]*)/;

    while (x < clearString.length)
    {
        var match = regex.exec(clearString.substr(x));
        if (match != null && match.length > 1 && match[1] != '')
        {
            output += match[1];
            x += match[1].length;
        }
        else
        {
            if (clearString[x] == ' ')
                output += '+';
            else
            {
                var charCode = clearString.charCodeAt(x);
                var hexVal = charCode.toString(16);
                output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
            }
            x++;
        }
    }

    function utf16to8(str)
    {
        var out, i, len, c;

        out = "";
        len = str.length;
        for(i = 0; i < len; i++)
        {
            c = str.charCodeAt(i);
            if ((c >= 0x0001) && (c <= 0x007F))
            {
                out += str.charAt(i);
            }
            else if (c > 0x07FF)
            {
                out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
                out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
                out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
            }
            else
            {
                out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
                out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
            }
        }
        return out;
    }

    return output;
}

/*emoji表情转unicode*/
function emoji2Str(str) {
    return unescape(escape(str).replace(/\%u[ED][0-9A-F]{3}\%u[ED][0-9A-F]{3}/g, ''));
}

//判断房屋类型
function getRoomType(num){
	switch (num) {
		case 1:
			return $.i18n.prop('c07ed19cfa7469bff581b06bdd34b819');
		case 2:
			return $.i18n.prop('0e1ca12c60c4b1c576f8ab0785186886');
		case 3:
			return $.i18n.prop('1e6de7de8aa946556b1cf6dae40ea040');
		default:
			return $.i18n.prop('b41192da514891b03ffb5091be668652');
	}
}

//查询订单状态
function getOrderStatus(orderId, failck) {
	var param = {
		'orderId': orderId,
		'userId': $.cookie('id'),
		'yyoh': $.cookie('yyoh')
	};

	var value = JSON.stringify(param);
	treatData("order/getOrderStatusById", value, function (data, url) {
		if (0 == data.status.status_code) {
			//如果订单已经支付成功
			if (data.result.status>=6 && data.result.status!=8) {
				window.location = '/payments/p_paymentsResult?result=ok';
			}else{
				failck && failck();
            }
		}
		else {
		}
	});
}


/*************************
 * 获取某人线上所有房源
 **************************/
function getOnlineHouselistByUserid(userId,page,pageSize,fn){
	var typeNum = '1';
	if($.cookie("buyer_currency")){
		typeNum = $.cookie("buyer_currency");
	}
    var param = {
	    userId: userId,
	    range: {
		    page: page-1,
		    pageSize: pageSize
        },
	    isCurrency: '1',
	    typeNum: typeNum
    };
	var value = JSON.stringify(param);

	treatData('house/getHouseListByUserId',value,function(data){
		if(fn){
		    fn(data)
        }
	},function(data){
	    alert(data.status_reason)
    });
}
/*************************
 * 创建房源
 **************************/
function createWebHouse(fn){
	var param = {};
	param.yyoh = $.cookie('yyoh');
	param.userId = $.cookie('id');
	param.attrValueList = {};
	var value = JSON.stringify(param);
	treatData('houseWeb/createWebHouse',value,function(data,url){
		if(fn){
			fn(data)
		}
	},function () {
        alert($.i18n.prop('7d6e2c05db2de363d50c648a291aefe9'));
	});
}
/*************************
 * 创建房源模块
 **************************/
function createHouseModule(aData,ifShowFaceUrl){
	var currency_symbol_arr = JSON.parse($.cookie("currency_symbol_arr") || '');
	var str = '';

	var mainPictureUrl = aData.mainPictureUrl || '/images/pic_default_image.png';
	var address = aData.levelName3 && aData.levelName3 != $.i18n.prop('60f4b90b2058c97e96664621aaaec790') ? aData.levelName3 : aData.levelName2;
	var price = parseInt(aData.houseCalendarPrice || aData.pricePerNight);
	var symbol = $.cookie("currency_symbol_arr") ? currency_symbol_arr[aData.currency-1].symbol : '￥';
	var commentStar = '';
    if(aData.commentCount > 0){
        aData.comprehensiveScore = aData.comprehensiveScore * 10;
        for(var j=0; j<parseInt((aData.comprehensiveScore+2)/10); j++){
            commentStar += '<img class="comment-star" src="/images/details/comment_star.png"/>';
        }
        if(aData.comprehensiveScore>=0 && aData.comprehensiveScore<=7 || (aData.comprehensiveScore % 10)>=3 && (aData.comprehensiveScore % 10)<=7){
            commentStar += '<img class="comment-star" src="/images/details/comment_half_star.png"/>';
        }
        for(var k=0; k<5-Math.ceil(Math.abs((aData.comprehensiveScore-2))/10); k++){
            commentStar += '<img class="comment-star" src="/images/details/comment_empty_star.png"/>';
        }
        commentStar += '<span class="commentCount">('+aData.commentCount+')</span>'
    }else{
        for(var j=0; j<5; j++){
            commentStar += '<img class="comment-star" src="/images/details/comment_star.png"/>';
        }
    }

	str += '                    <div class="one-house-item">\n' +
		'                        <a href="/h/'+aData.id+'">\n' +
		'                            <img src="'+mainPictureUrl+'" onerror="javascript:this.src=\'/images/lazyimg/pic_default_image_380_240.jpg\'" class="house-mainPic"/>\n' +
		'                        </a>\n' +
		'                        <div class="house-infoWrap">\n' +
		'                            <p class="house-title disEllipsis">'+ (aData.title||$.i18n.prop('0f2c50f54cd0435bf8ac68fadc1c35a4')) +' </p>\n' +
		'                            <p class="house-detail ellipsis">'+getRoomType(parseInt(aData.roomType))+'·'+aData.bedNum+$.i18n.prop('92a5c57198bc3677345de2bf327fcf19')+aData.accommodateNum+$.i18n.prop('9949013d1fdca0cdf87be73c3d23a502') + '</p>\n' +
		'                            <i class="line"></i>\n' + commentStar +
		'                            <div class="tags">\n' +
		(aData.flashOrderHouseFlag && aData.isFlash == 1 ? '<div>' + $.i18n.prop('b1be7d9ae8b4433435aace1a695825bc') + '</div>' : '') +
		(aData.hasTmallAirportTransfer && aData.hasTmallAirportTransfer == 1 || aData.hasAirportTransfer ==1 ? '<div>' + $.i18n.prop('d31ec617fdc25935b999645f1bb21339') + '</div>' : '') +
		'                            </div>\n' +
		(ifShowFaceUrl ? '<a href="/user/p_show?id='+aData.userId+'" target="_blank">' +
        '<img src="//'+publicMethods.pathSetting.picture_host+'/get.php?pn='+aData.faceUrl+ '&pt=0&st=small" alt="' + $.i18n.prop('10bad2f32a71dc8277359ddd274f46be') + '" class="faceUrl" onerror="javascript:this.src=\'/images/user_pic-225x225.png\'"/>' +
            '</a>>' : '') +
		'                        </div>\n' +
		'                        <div class="house-price">\n' +
		'                            <span class="buyer_currency_symbol" data-currency="'+aData.currency+'">'+symbol+'</span>\n' +
		'                            <span class="buyer_currency">'+price+'</span>\n' +
		'                        </div>\n' +
		(aData.isCollect && aData.isCollect == 1 ?
			'<img class="collectionIcon" data-id="'+aData.id+'" data-isCollect="1" src="/images/search/collection_red.png">' :
			'<img class="collectionIcon" data-id="'+aData.id+'" data-isCollect="0" src="/images/search/collection.png">') +
		'                    </div>';

	return str;
}

/*****************
 * 获取配置文件
 */
function getConfiguration(r) {
	treatData('appPageTop/pageTopInfo','',function(data){
		if(data.status.status_code){
			$.cookie('pictureNumMin',data.result.pictureNumMin,{"expires":10,path:"/"});
			return data.result[r];
		}
	})
}
/*****************
 * 翻译
 */
function getTranslateContent(subjectType,houseid,childTypes,fn) {
	var param = {};
	param.yyoh = $.cookie('yyoh');
	param.userId = $.cookie('id');
	param.keys = [];
	for(var i in childTypes){
		param.keys.push(subjectType+'-'+houseid+'-'+childTypes[i]);
    }
	var value = JSON.stringify(param);
	treatData('translate/getTranslateContent',value,function(data,url){
		if(fn){
			fn(data)
		}
	},function () {
		alert('远程访问连接失败');
	});
}

/*
 * 求两个数组的并集
 * @return array
 */
function bingji_array(a,b) {
	for (var i = 0, j = 0, ci, r = {}, c = []; ci = a[i++] || b[j++]; ) {
		if (r[ci]) continue;
		r[ci] = 1;
		c.push(ci);
	}
	return c;
}
/*
 * 求两个数组的差集
 * @return array
 */
function chaji_array(arr1,arr2){
	var arr3 = [];
	for (var i = 0; i < arr1.length; i++) {
		var flag = true;
		for (var j = 0; j < arr2.length; j++) {
			if (arr2[j] == arr1[i]) {
				flag = false;
			}
		}
		if (flag) {
			arr3.push(arr1[i]);
		}
	}
	return arr3;
}

/*************************
 * 设置不可选日期
 **************************/
function setInvalidTotalDate(houseId,dateStr,fn){
	var param = {};
	param.yyoh = $.cookie('yyoh');
	param.userId = $.cookie('id');
	param.houseId = houseId;
	param.dateStr = dateStr;
	var value = JSON.stringify(param);
	treatData('order/setInvalidTotalDate',value,function(data,url){
		if(fn){
			fn(data)
		}
	},function () {
		alert('远程访问连接失败');
	});
}
/*************************
 * 设置特殊价格
 **************************/
function setHouseCalendar(houseId,price,chooseDate,fn){
	var param = {};
	param.yyoh = $.cookie('yyoh');
	param.userId = $.cookie('id');
	param.houseId = houseId;
	param.price = price;
	param.chooseDate = chooseDate;
	var value = JSON.stringify(param);
	treatData('houseCalendar/setHouseCalendar',value,function(data,url){
		if(fn){
			fn(data)
		}
	},function () {
		alert('远程访问连接失败');
	});
}
/*************************
 * 数组去重
 **************************/
function arrayRemoveRepeat(arr) { // 去重
    try{
        var str = '';
        var newArr = [];
        for(var i in arr){
            str = ','+newArr.join(',')+',';
            if(str.indexOf(','+arr[i]+',') == -1){
                newArr.push(arr[i]);
            }
        }
        return newArr;
    }catch(e){
        return arr;
    }
}
/***根据入往日期、退房日期、入住人数，获取酒店价格列表 20181228
 *houseId（房源id），peopleNum（入住人数），startDate（入住日期），endDate（退房日期）,fn(回调函数)
 * **/
function hotelOrderCanBook(hotelId,roomId,planId,peopleNum,startDate,endDate,roomNum,checkUsableCoupon,fn){

    if(!hotelId)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('9925a1efea9778a876768dd031d21991')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!peopleNum)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('89641e3b949c1ba6db122dc06e15e7b1')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!startDate)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('29b39eb8a68e5717b0702639075c2c6f')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }
    if(!endDate)
    {
        var data={
            status:{
                status_code:-1,
                status_reason:$.i18n.prop('f8f06564500ff20c93ab4ca7c48b5788')
            }
        };
        if(fn)
        {
            fn(data);
            return;
        }

    }

    var typeNum = 1;
    if ($.cookie('buyer_currency')) {
        typeNum = $.cookie('buyer_currency');
    }
    var param = {};

    param.yyoh = $.cookie('yyoh');
    param.userId = $.cookie('id');
    param.hotelId = hotelId;
    param.roomId = roomId;
    param.planId = planId;
    param.roomNum = roomNum;
    param.checkUsableCoupon = checkUsableCoupon;
    param.peopleNum = peopleNum;
    param.startDate = startDate;
    param.endDate = endDate;
    param.typeNum = typeNum;

    var value = JSON.stringify(param);
    treatData('hotelOrder/canBook',value,function(data){
        if(fn){
            fn(data);
        }
    },function(){
        var status = {};
        status.status_code = -1;
        status.status_reason = $.i18n.prop('8769325cede51293d71b72d023adf0b9');
        if(fn){
            fn(status);
        }
    });

}